package com.woniuxy.controller;

import com.woniuxy.entity.RbacMenu;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.entity.UpRoleDTO;
import com.woniuxy.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO: 处理权限表的controller
 * <P> Date: 2022/2/24:17:32
 * <P> Description:
 */
@RestController
@RequestMapping("/menus")
public class MenuController {
    @Autowired
    MenuService menuService;


    @RequestMapping("/findAll")
    public ResponseEntity findAllPerm(){
        return menuService.findAll();
    }

    @GetMapping("/updateOne/{fatherNode}/{targetNode}")
    public ResponseEntity updateOne(@PathVariable Integer targetNode,@PathVariable Integer fatherNode){
       return menuService.updateOne(fatherNode,targetNode);
    }
    @RequestMapping("/updateMenus")
    public ResponseEntity updateMenus(@RequestBody RbacMenu rbacMenu){
        return  menuService.updateMenus(rbacMenu);
    }


}
